home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / bbsread / setlastread.br < prev   
Text File  |  1996-11-10  |  1KB  |  65 lines

  1. /* SetLastRead.br
  2.  *
  3.  * Set last read pointers for a bbs.
  4.  *
  5.  * Script by: Eivind Nordseth, Ultima Thule Software.
  6.  */
  7.  
  8.     EVE_DOCOMMAND    = 11  /* Command the script should do */
  9.  
  10.     parse arg argument
  11.  
  12.     if(argument = '') then
  13.     do
  14.         say '$VER: SetLastRead.br V3.1 (31.08.94)'
  15.         say 'Template: BBSNAME/A'
  16.         exit
  17.     end
  18.  
  19.     if ~show('p', 'BBSREAD') then do
  20.         address command
  21.             "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  22.             "WaitForPort BBSREAD"
  23.     end
  24.  
  25.     address BBSREAD
  26.  
  27.     GETCONFLIST stem CONFLIST argument 
  28.     if(rc ~= 0) then 
  29.     do
  30.         say BBSREAD.LASTERROR
  31.         exit
  32.     end
  33.  
  34.     do i=1 to CONFLIST.COUNT
  35.         GETCONFDATA argument '"'||CONFLIST.i||'"' stem CONFDATA
  36.         if(rc ~= 0) then 
  37.         do
  38.             say BBSREAD.LASTERROR
  39.             exit
  40.         end
  41.         
  42.         if CONFDATA.LASTMSG >= CONFDATA.FIRSTMSG then
  43.         do
  44.             say 'Setting last read for conference:' CONFLIST.i
  45.  
  46.             READBRMESSAGE argument '"'||CONFLIST.i||'"' CONFDATA.LASTMSG headstem HEADTAGS
  47.             if(rc ~= 0) then 
  48.             do
  49.                 say BBSREAD.LASTERROR
  50.                 exit
  51.             end
  52.             
  53.             drop EVENT.
  54.  
  55.             EVENT.COMMANDSTRING = "j " || CONFLIST.i || " m s " || HEADTAGS.ORGINALNR
  56.  
  57.             WRITEBREVENT argument EVE_DOCOMMAND stem EVENT
  58.             if(rc ~= 0) then 
  59.             do
  60.                 say BBSREAD.LASTERROR
  61.                 exit
  62.             end
  63.         end
  64.     end
  65.